<?php

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/


Route::group(['namespace' => 'Api', 'prefix' => 'app'], function () {
    Route::get('auth/wechat', 'AuthController@wechat');
    Route::post('auth/mobile', 'AuthController@mobile');
});

Route::group(['namespace' => 'Api\Third', 'prefix' => 'third'], function () {
    Route::any('wechat', 'WechatController@index');
    Route::get('wechat/prepare', 'WechatController@prepare');
    Route::post('wechat/notify', 'WechatController@notify');
    Route::get('wechat/menu', 'WechatController@menu');
    Route::post('wechat/share', 'WechatController@share');
});

Route::group(['namespace' => 'Api', 'middleware' => ['wechat.oauth', 'auth']], function () {
    Route::get('user/qrcode', 'UserController@qrcode');
    Route::get('user/qrcode_list', 'UserController@qrcode_list');
    Route::get('user/center', 'UserController@center');
    Route::get('user/fan', 'UserController@fan');
    Route::get('user/status', 'UserController@status');
    Route::post('user/sendcode', 'UserController@sendcode');
    Route::post('user/checkcode', 'UserController@checkcode');

    //商城
    Route::group(['namespace' => 'Mall', 'prefix' => 'mall'], function () {
        Route::get('carousel', 'IndexController@carousel');
        Route::get('rotation', 'IndexController@rotation');
        Route::get('game', 'IndexController@game');
        Route::get('foot', 'IndexController@foot');
        Route::get('products/list', 'ProductsController@productList');
        Route::get('products/detail', 'ProductsController@productDetail');
        Route::get('order/list', 'OrderController@orderList');
        Route::get('order/detail', 'OrderController@orderDetail');
        Route::get('order/express', 'OrderController@orderExpress');
        Route::post('order/update', 'OrderController@orderUpdate');
        Route::post('products/exchange', 'PayController@exchange');
        Route::get('pointcard/list', 'PointCardController@pointcardList');
        Route::get('pointcard/status', 'PointCardController@pointcardStatus');
    });

    //微信红包
    Route::post('third/wechat/lucky-money', 'Third\WechatController@lucky_money');
});

